package com.duothread;

// 生产手机的任务类
public class ProduceTask implements Runnable {
    private PhoneFactory pf;

    public ProduceTask(PhoneFactory pf) {
        this.pf = pf;
    }

    @Override
    public void run() {
        while (true) {
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            pf.produce();
        }
    }
}
